package com.song.druid.model;

import com.github.pagehelper.Page;
import lombok.Data;

import java.util.List;

@Data
public class PageInfo<T> {
    private int pageNum;
    private int pageSize;
    private int pages;
    private long total;
    private List<T> records;

    private static PageInfo instance = new PageInfo();

    public static PageInfo transfer(Page page){
        instance.setPageNum(page.getPageNum());
        instance.setPageSize(page.getPageSize());
        instance.setPages(page.getPages());
        instance.setTotal(page.getTotal());
        instance.setRecords(page.getResult());
        return instance;
    }
}
